package pers.xx.sbm.vo;

import lombok.Getter;
import lombok.Setter;

/**
 * @author ：xiexing
 * @description：角色样本统计VO
 * @date ：2021/12/15 14:28
 */
@Getter
@Setter
public class RoleSamplePercentVo {
    private Integer studentNum;//学生数量统计
    private Double studentPercent;//学生所占比例
    private Integer teacherNum;//老师数量统计
    private Double teacherPercent;//老师所占比例
    private Integer parentNum;//家长数量
    private Double parentPercent;//家长所占比例
    private Integer yzNum;//园长数量
    private Double yzPercent;//园长所占比例
    private Integer rddbNum;//人大代表/政协委员数量
    private Double rddbPercent;//人大代表/政协委员比例
    private Integer allNum;//各个角色数量统计

    public void setStudentNum(Integer studentNum) {
        if (studentNum == null) {
            this.studentNum = 0;
        } else {
            this.studentNum = studentNum;
        }

    }

    public void setTeacherNum(Integer teacherNum) {
        if (teacherNum == null) {
            this.teacherNum = 0;
        } else {
            this.teacherNum = teacherNum;
        }
    }

    public void setParentNum(Integer parentNum) {
        if (parentNum == null) {
            this.parentNum = 0;
        } else {
            this.parentNum = parentNum;
        }
    }

    public void setYzNum(Integer yzNum) {
        if (yzNum == null) {
            this.yzNum = 0;
        } else {
            this.yzNum = yzNum;
        }
    }

    public void setRddbNum(Integer rddbNum) {
        if (rddbNum == null) {
            this.rddbNum = 0;
        } else {
            this.rddbNum = rddbNum;
        }
    }

    /**
     * @description 设置数据
     * @author XieXing
     * @date 2021/12/15 16:06
     */
    public void setData() {

        allNum = studentNum + teacherNum + yzNum + rddbNum;

        studentPercent = studentNum * 1.0 / allNum * 100;

        teacherPercent = teacherNum * 1.0 / allNum * 100;

        parentPercent = parentNum * 1.0 / allNum * 100;

        yzPercent = yzNum * 1.0 / allNum * 100;

        rddbPercent = rddbNum * 1.0 / allNum * 100;

    }

}
